home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.3 / Video Toaster v4.3.iso / 3.1 / toasterall / arexx_examples / lwm / points2polys.lwm < prev    next >
Text File  |  1993-06-08  |  1KB  |  54 lines

  1. /* CMD: Points->Polys
  2.  * Convert All points to single point polygons. Cut whole object.
  3.  * By Arnie Cachelin © 1992 NewTek Inc. */
  4.  
  5. call addlib "LWModelerARexx.port", 0
  6. sysnam = 'Points To Polygons'
  7. signal on error
  8. signal on syntax
  9.  
  10. /* call removepols() */ /* This command doesn't create 1-point polygons... */
  11. csurf=CurSurface()
  12. call req_begin sysnam
  13.  
  14. id_txt = req_addcontrol("Convert Object", 'T',"To 1-Point Polygons")
  15. id_srf = req_addcontrol("Surfaces",'R')
  16. if (~req_post()) then do
  17.     call req_end
  18.     exit
  19. end
  20. surf = req_getval(id_srf)
  21. call req_end()
  22. say surf Csurf
  23. if surf~=CSurf then call surface(surf)
  24.  
  25. n = xfrm_begin()
  26. say n
  27. call meter_begin 2*n, 'Transforming 'n' Points'
  28. do i = 1 to n
  29.   Point.i= xfrm_getpos(i)
  30.   say Point.i
  31.   call meter_step
  32.   end
  33. call xfrm_end()
  34. call CUT()
  35. call add_begin()
  36. do i=1 to n
  37.   call add_point Point.i
  38.   call add_polygon i
  39.   end
  40. call add_end()
  41. call remlib "LWModelerARexx.port"
  42. exit
  43.  
  44. syntax:
  45. error:
  46.   call end_all
  47.     t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
  48.     exit
  49.  
  50. PointCount: PROCEDURE
  51.   n=XFRM_BEGIN()
  52.   call END_ALL()
  53.   return n
  54.